export const List = ({ info, name, price, kanJia, id }) => {
  const kan = () => {
    const kanPrice = +(Math.random() * 5).toFixed(2)
    if (kanPrice === 0) {
      kanPrice = 0
    }
    kanJia(id, kanPrice)
  }
  return (
    <div className="child">
      <div className="product">
        <h3>标题：{name}</h3>
        <div>价格：{price}</div>
        <div>{info}</div>
        <button onClick={kan}>砍价</button>
      </div>
    </div>
  )
}
